// 引入axios
import request from '@/utils/request'
// 搜索售货机(售货机列表) 接口
export const getvmlist = (params) =>
  request({
    method: 'get',
    url: '/vm-service/vm/search',
    params
  })
// 点击新建按钮要的接口
// 获取型号的
export const getvmmodel = (params) =>
  request({
    method: 'get',
    url: '/vm-service/vmType/search',
    params
  })
// 获取点位的
export const getvmposition = (params) =>
  request({
    method: 'get',
    url: '/vm-service/node/search',
    params
  })
// 新增售货机
export const getnewvending = (data) =>
  request({
    method: 'POST',
    url: '/vm-service/vm',
    data
  })
// 设备类型管理的接口
export const gettypelist = (params) =>
  request({
    method: 'get',
    url: '/vm-service/vmType/search',
    params
  })
// 获取一定时间范围之内的订单总数
export const getintimeorder = (params) =>
  request({
    method: 'get',
    url: '/order-service/report/orderCount',
    params
  })
// 获取一定时间范围之内的收入
export const getintimemoney = (params) =>
  request({
    method: 'get',
    url: '/order-service/report/orderAmount',
    params
  })
// 获取售货机补货次数
export const getReplenishmenttimes = (params) =>
  request({
    method: 'get',
    url: `/task-service/task/supplyCount/${params.innerCode}/${params.start}/${params.end}`
  })
// 获取售货机维修次数
export const getrepairCount = (params) =>
  request({
    method: 'get',
    url: `/task-service/task/repairCount/${params.innerCode}/${params.start}/${params.end}`
  })
// 获取售货机商品销量

export const getskuCollect = (params) =>
  request({
    method: 'get',
    url: `/order-service/report/skuCollect/${params.innerCode}/${params.start}/${params.end}`
  })
// 型号搜索
export const getvmType = (params) =>
  request({
    method: 'get',
    url: '/vm-service/vmType/search',
    params
  })
// 新增售货机类型

export const getnewvmtype = (data) =>
  request({
    method: 'POST',
    url: '/vm-service/vmType',
    data
  })

// 图片上传
export const FileUpload = (data) =>
  request({
    method: 'POST',
    url: '/vm-service/sku/fileUpload',
    data
  })
// 修改售卖机
export const updateVmType = (data) =>
  request.put(`/vm-service/vmType/${data.typeId}`, data)

//
//
//
//
//
//
// 订单管理  获取所有订单
export const getallorder = (params) =>
  request({
    method: 'get',
    // url: `/order-service/order/search/${params.pageIndex}/${params.pageSize}${params.orderNo}${params.startDate}${params.endDate}`
    url: '/order-service/order/search/',
    params
  })
  //
  // 点击修改 获取所有点位
export const getallnode = (params) =>
  request({
    method: 'get',
    // url: `/order-service/order/search/${params.pageIndex}/${params.pageSize}${params.orderNo}${params.startDate}${params.endDate}`
    url: '/vm-service/node/search',
    params
  })
